package work20241210.a_String;

/**
 * @author zdl
 * @date 2024/12/10
 */
public class StringStartsWith {
    public static void main(String[] args) {
        String str = "张三";
        System.out.println(str.startsWith("张")); //判断是否以指定字符开头(前缀)
        char[] charArray = str.toCharArray();
        if (charArray[0] == '张'){
            System.out.println("true");
        }else {
            System.out.println("false");
        }

    }
}
